import "./App.scss"
import { Router, Route, Switch, Redirect } from "react-router-dom"
import Layout from "@/pages/Layout"
import Login from "@/pages/Login"
import AuthRoute from "./components/AuthRoute"
import NotFound from "./pages/NotFound"
import history from "./utils/history"
function App() {
  return (
    <Router history={history}>
      <div className="App">
        <Switch>
          <Redirect exact path="/" to="/home"></Redirect>
          <Route exact path="/login" component={Login}></Route>
          <AuthRoute path="/home" component={Layout}></AuthRoute>
          {/* 当满足path的时候  就会跳到 home页 */}
          <Route>
            <NotFound></NotFound>
          </Route>
        </Switch>
      </div>
    </Router>
  )
}

export default App
